import { get, post } from './api'
// 创建训练
export function create(name, introduction, uid, chineseName) {
    return post('/build/create', {
        name,
        introduction,
        uid,
        chineseName,
    })
}

// 教员获取系统中已有的训练
export function getTrainings() {
    return get('/build/getTrainings')
}

// 打开系统中已有的训练
export function open(training_id) {
    return get('/build/open', {
        training_id
    })
}
// -----------------------
export function save(training_id) {
    return post('/build/save', { training_id })
}
// 获取数据库中的训练基础指标(供客户端配置算子使用)
export const getTargets = () => get('/build/getTargets')
export const getAllTrainings = student_id => get('/training/all', { student_id })
export const getBrieflyInfo = (student_id, training_id) => get('/training/stat', { student_id, training_id })
export const getDetailInfo = (student_id, training_id, timestamp) => get('/training/dis', { student_id, training_id, timestamp })
export const pointsRate = (class_id, training_id) => get('/training/pointsRate', { class_id, training_id })
export const changedOrException = (class_id, training_id, type) => get('/build/changedOrException', { class_id, training_id, type })
